package chapter14;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/13 16:37
 */
interface Null {
}

public class Person {
    public static final Person nullPerson = new NullPerson();
    private final String first;
    private final String last;
    private final String address;

    public Person(String first, String last, String address) {
        this.first = first;
        this.last = last;
        this.address = address;
    }

    @Override
    public String toString() {
        return "Person{" +
                "first='" + first + '\'' +
                ", last='" + last + '\'' +
                ", address='" + address + '\'' +
                '}';
    }

    public static class NullPerson extends Person implements Null {

        public NullPerson() {
            super("none", "none", "none");
        }

        @Override
        public String toString() {
            return "null person";
        }
    }
}
